package com.ztgf.user.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.ztgf.user.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.user.mapper.UserLoginLogMapper;
import com.ztgf.user.models.service.IUserLoginLogService;
import com.ztgf.user.models.bo.UserLoginLogSaveBO;
import com.ztgf.user.models.dto.UserLoginLogDTO;

/**
 * 用户登录日志表控制器
 *
 * @author zhanghualang
 * @Date 2020-05-28 17:44:59
 */
@DubboService
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLogDTO> implements IUserLoginLogService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(UserLoginLogSaveBO saveBO) {
        UserLoginLogDTO dto = new UserLoginLogDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
